addBrand
With this API call, the SaaS provider or ISV can add a brand to the current brands that have been synchronized via the initializeBrand API.
Note: To add a store, make sure one of the following conditions are met:
- The ShoppingArea object has been synchronized via the initializeShoppingArea or addShoppingArea API, if the store belongs to a shopping area.
- The Brand object has been synchronized via the initializeBrand or addBrand API, if the store belongs to a brand.
Structure
A message consists of a header and body. The following sections are focused on the body structure. For the header structure, see:
Request parameters
Field | Data type | Required | Description | Example |
requestId | String | Yes | Indicates the unique ID assigned by the SaaS provider or ISV to identify a request for adding a brand.
Note: This field is an idempotency field. For the addBrand requests using the same requestId value, our server must return the same result. For details about API idempotency, see the Idempotency chapter. | "brand_2022012111061234567890" |
brand | Yes | Indicates the details of the brand to add. | - |
Response parameters
Field | Data type | Required | Description |
result | Yes | Indicates the request result, such as status and error codes. |
Result process logic
In the response, the result.resultStatus field indicates the result of processing a request. The following table describes each result status:
Result status | Description |
A | The request for adding the brand is accepted by us. The corresponding result.resultCode and result.resultMessage may vary based on different situations. For details, see the following Error codes section. |
S | The brand is added successfully. The corresponding result.resultCode is |
U | The status of the request to add the brand is unknown. The corresponding result.resultCode is For details, see the Common error codes section. |
F | Failed to add the brand. The corresponding result.resultCode and result.resultMessage may vary based on different situations. For details, see the following Error codes section. |
Error codes
Error codes are usually classified into the following categories:
- Common error codes are common for F&B mini program OpenAPIs. Â
Samples
Request
{
"requestId": "f8c7662571bf44d341e9bb69ecf3fcf3",
"brand": {
"brandId": "V0020011232211111122122",
"brandName": "Brand B",
"brandImage": [
"https://wwww.example.com/images/uploads/meals/2cf2dfssdmgkeqec1c.png"
]
}
}
Response
{
"result": {
"resultCode": "SUCCESS",
"resultStatus": "S",
"resultMessage": "success"
}
}